<div class="cil__detail-rest-info--label">
  <span>{{('BIZ.ACQUIRER.ACQUIRER_FUNC.SINGLE_MESSAGE' | i18n) + '/' + ('BIZ.ACQUIRER.ACQUIRER_FUNC.DUAL_MESSAGE' | i18n)}}</span>
</div>
<nz-spin *ngIf="isLoading"></nz-spin>

<ng-container *ngIf="!isLoading">
  <app-info-row
    *ngFor="let column of columns[fields.DualMessage]; let rowIndex = index"
    [ifEdit]="isEdits[fields.DualMessage][rowIndex]"
    [columns]="column"
    (active)="activeItem($event, rowIndex)"
    [rowIndex]="rowIndex">
  </app-info-row>

  <div class="cil__detail-rest-info--label">
    <span>{{('BIZ.STORE.OTHER.SETTLEMENT.PERIOD_CONFIG' | i18n)}}</span>
  </div>
  <app-info-row
    *ngFor="let column of columns[fields.SettleCycle]; let rowIndex = index"
    [ifEdit]="isEdits[fields.SettleCycle][rowIndex]"
    [columns]="column"
    [rowIndex]="rowIndex"
    (active)="activeItem($event, rowIndex)"
  ></app-info-row>

  <div class="cil__detail-rest-info--label" translate-origin="账户配置">
    <span>{{'BIZ.STORE.OTHER.SETTLEMENT.ACCOUNT_CONFIG' | i18n}}</span>
  </div>
  <div class="cil__bottom-columns-block">
    <app-info-row
      *ngFor="let column of columns[fields.Account]; let rowIndex = index"
      [ifEdit]="isEdits[fields.Account][rowIndex]"
      [columns]="column"
      (active)="activeItem($event, rowIndex)"
      [rowIndex]="rowIndex">
    </app-info-row>
  </div>
</ng-container>

<ng-template #tpIsSupportDualMessage let-column="column">
  <nz-radio-group [(ngModel)]="column.value" (ngModelChange)="switchIsSupportDualMessage($event)">
    <label nz-radio nzValue="0">{{'BIZ.ACQUIRER.ACQUIRER_FUNC.SINGLE_MESSAGE' | i18n}}</label>
    <label nz-radio nzValue="1">{{'BIZ.ACQUIRER.ACQUIRER_FUNC.DUAL_MESSAGE' | i18n}}</label>
  </nz-radio-group>
</ng-template>

<ng-template #tpSettleTime let-column="column">
  <nz-select
    style="width: 100%;"
    [ngModel]="column.value"
    [nzAllowClear]="false"
    name="settleTime"
    (ngModelChange)="selectSettleTime($event)"
  >
    <nz-option
      *ngFor="let op of settleTimeOptions"
      [nzLabel]="op.label"
      [nzValue]="op.value"
      nzCustomContent
    >
      <span>{{op.label}}</span>
    </nz-option>
  </nz-select>
</ng-template>

<ng-template #tpSettleType let-column="column">
  <nz-select
    style="width: 100%;"
    [ngModel]="column.value"
    [nzAllowClear]="false"
    name="settleType"
    (ngModelChange)="selectSettleType($event)"
  >
    <nz-option
      *ngFor="let op of settleTypeOptions"
      [nzLabel]="op.label"
      [nzValue]="op.value"
      nzCustomContent
    >
      <span>{{op.label}}</span>
    </nz-option>
  </nz-select>
</ng-template>

<ng-template #tpSettleDays let-column="column">
  <nz-input-number
    [nzDisabled]="disabled"
    [nzMin]="min"
    [nzMax]="max"
    [nzStep]="step"
    [nzPrecision]="precision"
    [ngModel]="column.value"
    (ngModelChange)="changeSettleDays($event)"
  ></nz-input-number>
</ng-template>

<ng-template #dualOperate let-rowIndex="rowIndex">
  <app-rest-edit
    [editing]="isEdits[fields.DualMessage][rowIndex]"
    (edit)="edit(fields.DualMessage, rowIndex)"
    (cancel)="cancel()"
    (submit)="submit()"
  ></app-rest-edit>
</ng-template>

<ng-template #settleCycleOperate let-rowIndex="rowIndex">
  <app-rest-edit
    [editing]="isEdits[fields.SettleCycle][rowIndex]"
    (edit)="edit(fields.SettleCycle, rowIndex)"
    (cancel)="cancel()"
    (submit)="submit()"
  ></app-rest-edit>
</ng-template>

<ng-template #accountOperate let-rowIndex="rowIndex">
  <app-rest-edit
    [editing]="isEdits[fields.Account][rowIndex]"
    (edit)="edit(fields.Account, rowIndex)"
    (cancel)="cancel()"
    (submit)="submit()">
  </app-rest-edit>
</ng-template>